FROM malexer/twemproxy:latest

RUN apk add -U tzdata
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

ENV LISTEN_PORT 6379
ENV AUTO_EJECT_HOSTS true
ENV TIMEOUT 2000
ENV SERVER_RETRY_TIMEOUT 5000
ENV SERVER_FAILURE_LIMIT 1
ENV SERVER_CONNECTIONS 40
ENV PRECONNECT true
ENV REDIS_SERVERS 127.0.0.1:6378:1,127.0.0.1:6380:1

EXPOSE 6379
EXPOSE 22222